package com.oneday.nuo;


import com.oneday.nuo.base.security.interceptor.CORSFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author liushuai
 * @date 2020/8/23 16:22
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Bean
    public FilterRegistrationBean CORSFilterRegist() {
        FilterRegistrationBean frBean = new FilterRegistrationBean();
        frBean.setFilter(new CORSFilter());
        frBean.addUrlPatterns("/*");
        return frBean;
    }
}
